[paket]
tanim   = Alliance for Open Media video kodeği ve set kütüphaneleri
paketci = milisarge
grup    = kütüphane
url     = https://aomedia.org/

[gerek]
derleme = cmake meson python yasm nasm libjpeg-turbo xxhash gdk-pixbuf xiph libwebp
calisma =

[kaynak]
1       = https://storage.googleapis.com/aom-releases/libaom-$surum.tar.gz::$isim-$surum.tar.gz
2       = https://gitlab.com/AOMediaCodec/SVT-AV1/-/archive/v1.6.0/SVT-AV1-v1.6.0.tar.bz2
3       = https://chromium.googlesource.com/libyuv/libyuv/+archive/3aebf69d668177e7ee6dbbe0025e5c3dbb525ff2.tar.gz
4       = https://code.videolan.org/videolan/dav1d/-/archive/1.2.1/dav1d-1.2.1.tar.gz
5       = https://github.com/AOMediaCodec/libavif/archive/v1.0.1/libavif-1.0.1.tar.gz

[sha256]
1       = 42b862f58b3d00bd3902d2dc469526574f5b012e5b178e6a9652845a113d6887

[derle]
export  = LIBRARY_PATH="$LIBRARY_PATH:$PKG/usr/lib"
export  = CFLAGS="$CFLAGS -I$PKG/usr/include"
export  = PKG_CONFIG_PATH=$(pkg-config --variable pc_path pkg-config):$PKG/usr/lib/pkgconfig/
export  = LD_LIBRARY_PATH=/usr/lib:$PKG/usr/lib

; dav1d
meson  = dav1d-1.2.1

; libyuv
betik  = cd $SRC/libyuv-*
betik  = sed -i 's|yuvconvert ${JPEG_LIBRARY}|${ly_lib_shared} ${JPEG_LIBRARY}|' CMakeLists.txt
betik  = cmake -S . -B buildyuv -G Ninja $CMAKE_OPT
betik  = cmake --build buildyuv $MAKEJOBS
betik  = DESTDIR=$PKG cmake --install buildyuv
  
; svt-av1
export = LDFLAGS="$LDFLAGS -Wl,-z,noexecstack"
betik  = cmake -S $SRC/SVT-AV1-v1.6.0 -B buildsvt -G Ninja $CMAKE_OPT -DBUILD_SHARED_LIBS=ON -DNATIVE=OFF
betik  = ninja -C buildsvt $MAKEJOBS
betik  = DESTDIR=${PKG} ninja -C buildsvt install

; aom - merkez paket
betik  = cmake -S $SRC/libaom-$surum -B buildaom -G Ninja $CMAKE_OPT -DENABLE_TESTS=0 -DENABLE_CCACHE=1 -DENABLE_DOCS=OFF -DBUILD_SHARED_LIBS=ON
betik  = cmake --build buildaom $MAKEJOBS
betik  = DESTDIR=$PKG cmake --install buildaom

; libavif
export = AVIF_OPT="-DAVIF_BUILD_APPS=ON -DAVIF_CODEC_AOM=ON -DAVIF_CODEC_DAV1D=ON -DAVIF_CODEC_RAV1E=ON -DAVIF_CODEC_SVT=ON -DAVIF_BUILD_GDK_PIXBUF=ON"
export = DEPS="-DDAV1D_INCLUDE_DIR=$PKG/usr/include -DDAV1D_LIBRARY=$PKG/usr/lib/libdav1d.so "
export = DEPS+="-DLIBYUV_INCLUDE_DIR=$PKG/usr/include -DLIBYUV_LIBRARY=$PKG/usr/lib/libyuv.so "
export = DEPS+="-DSVT_INCLUDE_DIR=$PKG/usr/include -DSVT_LIBRARY=$PKG/usr/lib/libSvtAv1Enc.so "
export = DEPS+="-DAOM_INCLUDE_DIR=$PKG/usr/include -DAOM_LIBRARY=$PKG/usr/lib/libaom.so"
betik  = cmake -B buildavif -S $SRC/libavif-1.0.1 $CMAKE_OPT $AVIF_OPT $DEPS
betik  = make -C buildavif $MAKEJOBS
betik  = make -C buildavif DESTDIR=$PKG install

[pakur]
betik  = echo "pakur yok"
betik  = rm -rf $PKG/usr/lib/*.a
